<!--
 * @Author: 陈娇
 * @Date: 2021-04-13 14:41:37
 * @LastEditTime: 2021-05-29 09:27:50
 * @LastEditors: Please set LastEditors
 * @Description: 日志管理
 * @FilePath: \ebc-admin\src\views\system\LogManagement.vue
-->
<template>
  <div>
    <!-- 列表 -->
    <tab-list
      ref="list"
      :searchs="searchs"
      :list-hedar="listHedar"
      :params="params"
      :api-function="apiFunction"
      :set-list-data="show"
      @init-params="initParams"
    >
      <template slot="res" slot-scope="scope">
        <div>{{ scope.value.res.data }}</div>
        <div>{{ scope.value.res.message }}</div>
      </template>
    </tab-list>
  </div>
</template>

<script>
// 组件
import tabList from '@/components/admin/tab-list.vue'

// 数据封装
import { searchs, listHedar } from './log.config'

// 接口
import { logRecords } from '@/api/system.js'

export default {
  name: 'LogManagement',
  components: {
    tabList
  },
  data() {
    return {
      searchs,
      listHedar,
      params: {},
      apiFunction: logRecords,
      detailInfo: {},
      eventContent: {}
    }
  },
  methods: {
    show(list) {
      list.forEach(item => {
        let _res = JSON.parse(item.res)
        _res = _res || { data: '', message: '' }
        item.res = _res
      })
      return list
    },
    // 初始化列表请求参数
    initParams(param) {
      this.params = param
    }
  }

}
</script>

<style lang="scss" scoped>

</style>
